package com.bright.ghj.overt.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

/**
 * @author Tz
 * @date 2024/01/22 15:03
 * @Description 多 jdbcTemplate 工具
 */
@Configuration
public class MultipleJdbcTemplateConfig {

    @Bean
    public JdbcTemplate jdbcTemplatePrimary(@Qualifier("primaryDataSource") DataSource dataSource) {
        return new JdbcTemplate(dataSource);
    }

    @Bean
    public JdbcTemplate jdbcTemplateSecond(@Qualifier("secondDataSource") DataSource dataSource) {
        return new JdbcTemplate(dataSource);
    }

}
